/*
    编写函数把一个数组中所有数字追加到另外一个数组的末尾，用返回值表示
    合并后的数组。（用指针实现）
*/
#include <stdio.h>
#include <string.h>
/*char *str(char *p_arr,char *p_brr) {
    strcat(p_arr,p_brr);
    return p_arr;
}
int main() {
    char arr[20] = "12345", brr[5] = "abc";
    str(arr,brr);
    printf("%s\n", arr);
    return 0;
}*/
int *combine(int *p_dest,int dsize, const int *p_src, int ssize ) {
    int *p_dest1 = p_dest + dsize;
    const int *p_src1 = p_src;
    while(p_src +ssize > p_src1) {
	*p_dest1 = *p_src1;
    	p_src1++;
	p_dest1++;
    }
    return p_dest;
} 
int main() {
    int arr1[20] = {1,2,3,4};
    int arr2[] = {5,6,7}, num = 0;
    int *p_dest = combine(arr1, 4,arr2, 3);
    for(num = 0; num <= 6; num++) {
	printf("%d", arr1[num]);
    	printf("%d", *(p_dest + num));
    }
    printf("\n");
    return 0;
}
